<tr class="<%= cycle('even', 'odd') %>">
  <td class="icon"><%= content_tag 'span', '', class: "icon user#{user.gender == 'female' ? ' female' : ' male'}" %></td>
  <td>
    <%= render_icon(user.logged_in? ? 'online' : 'offline') %>
  </td>
  <td class="login"><%= user.login %></td>
  <td class="name"><%= user.firstname %></td>
  <td><%= user.lastname %></td>
  <td class="email"><%= user.email %></td>
  <td><%= Alchemy.t(user.language, scope: 'translations', default: Alchemy.t(:unknown)) %></td>
  <td><%= user.last_sign_in_at.present? ? l(user.last_sign_in_at, format: :default) : Alchemy.t(:unknown) %></td>
  <td class="role"><%= user.human_roles_string %></td>
  <td class="tools">
  <% if can?(:destroy, user) %>
    <%= delete_button alchemy.admin_user_path(user), {
      message: Alchemy.t(:confirm_to_delete_user),
      title: Alchemy.t(:delete_user),
      icon: "user_delete#{user.gender == 'female' ? ' female' : ' male'}"
    } %>
  <% end %>
  <% if can?(:edit, user) %>
    <%= link_to_dialog '',
      alchemy.edit_admin_user_path(user), {
        title: Alchemy.t(:edit_user),
        overflow: true,
        size: '430x560'
      }, {
        class: "icon user_edit#{user.gender == 'female' ? ' female' : ' male'}",
        title: Alchemy.t(:edit_user)
      }
    %>
  <% end %>
  </td>
</tr>
